package Utils;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

/**
 * @author 锄禾
 * @projectName MkPack
 * @description: 常用的文件操作类
 */
public class FileOperat {

    /**
    　* @description: 一次读取文件全部数据
    　* @param
    　* @return
    　*/
    public static String readFile(String fileName){
        String content = "";

        try {
            InputStream input = new FileInputStream(fileName);
            int iav = input.available();
            byte[] bytes = new byte[iav];
            input.read(bytes);
            content = new String(bytes);
            input.close();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            return content;
        }

    }
}
